-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ci): upload built binaries to GitHub Releases on tag creation #810
Conversation
permissions: | ||
contents: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should provide the workflow with permissions to upload assets to GitHub releases.
@@ -20,26 +24,30 @@ jobs: | |||
|
|||
steps: | |||
- name: Checkout code | |||
uses: actions/checkout@v3 | |||
uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a new Checkout action
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22.1' | ||
go-version-file: ./go.mod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop maintaining the Go version in two places.
|
||
- name: Build binary on Linux and macOS | ||
if: matrix.os != 'windows-latest' | ||
env: | ||
OS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebrand the ubuntu-latest
binary to linux
, and the macos-latest
binary to darwin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strongly suggest removing the "put inside dmg" step on macos/darwin while you're at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I'm not on the project, or involved in any way, I don't want to remove any functionality in this PR. That's a decision for the maintainers.
I have, however, updated the pipeline to keep the MacOS binary around as well as the dmg in 3b35d88.
|
||
- name: Build binary on Windows | ||
if: matrix.os == 'windows-latest' | ||
env: | ||
OS: windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebrand the windows-latest
binary to windows
- name: Upload release artifact | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
run: | | ||
gh release upload ${{ github.ref_name }} fabric-*-${{ matrix.arch }}-${{ github.ref_name }}* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upload the built files to GitHub Releases when invoked from a tag push.
Not entirely sure if this will work, but it will at least attempt to upload the artifacts.
What this Pull Request (PR) does
Updates the GitHub Actions workflow to be triggered on tag creation.
On tag creation, it runs the regular builds, but the only difference is a final step to upload the artifacts to GitHub Releases so they are discoverable.
Also manages the Go version in a single go.mod file, rather than across two different files, where the workflow version is easily forgotten.
Finally updates the binary names to not include the distribution. ubuntu-latest binaries work on Fedora, so therefore it makes more sense to me to call them
linux
anddarwin
.Related issues
Closes #808